package com.cac.demo.service.sortDelivery;

import com.cac.demo.dao.sortDelivery.SortDeliveryDao;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class SortDeliveryService {
    @Autowired
    private SortDeliveryDao sortDeliveryDao;

    public PageInfo querySortMatchByParam(HashMap page, HashMap queryMap){
        int currentPage = Integer.parseInt(page.get("currentPage").toString());
        int pageSize = Integer.parseInt(page.get("pageSize").toString());
        PageHelper.startPage(currentPage,pageSize);
        return new PageInfo(sortDeliveryDao.querySendMaterial(queryMap));
    }

    public PageInfo querySendTool(HashMap page, HashMap queryMap){
        int currentPage = Integer.parseInt(page.get("currentPage").toString());
        int pageSize = Integer.parseInt(page.get("pageSize").toString());
        PageHelper.startPage(currentPage,pageSize);
        return new PageInfo(sortDeliveryDao.querySendTool(queryMap));
    }
}
